using Amazon.ECS;
using Amazon.ECS.Model;
using RomanJendrusz.Amazon.ETL.Messages;

namespace RomanJendrusz.Amazon.ETL.Infrastructure.Bus.RequestHandlers
{
    public class ItemLookupRequestHandler: AbstractRequestHandler<ItemLookupRequest, ItemLookupResponse>
    {   
        public ItemLookupRequestHandler(AmazonECSFactory remoteServiceFactory)
            : base(remoteServiceFactory)
        {
        }
        
        public ItemLookupRequestHandler(AmazonECS remoteService)
            : base(remoteService)
        {
        }

        protected override ItemLookupResponse ExecuteRemoteCall(params ItemLookupRequest[] requests)
        {
            return remoteService.ItemLookup(requests);
        }

        protected override bool ValidateRequest(AmazonRequest request)
        {
            return request.Destination == AwsDestinations.ItemLookup;
        }
    }
}